<template>
	<div id="pdf-app">
		<div id="pdf"></div>
	</div>
</template>

<script>
	import common from '@/utils/common.js';
	import {
		cloneDeep
	} from 'lodash'
	import Pdfh5 from "pdfh5";
	import "pdfh5/css/pdfh5.css";
	export default {
		name: 'app_photo_requirement_one',
		// beforeRouteLeave(to, from, next) {
		// 	this.$destroy();
		// 	next();
		// },
		beforeDestroy() {},
		props: {},
		data() {
			return {
				pdfUrl: {
					'1': 'https://meilai-test-3.oss-cn-hangzhou.aliyuncs.com/%E7%BE%8E%E8%8E%B1%E6%96%87%E5%8C%96%E6%99%BA%E8%83%BD%E6%84%9F%E5%BA%94%E6%A1%86%E6%9E%B6%E6%8B%8D%E7%85%A7%E6%A0%87%E5%87%86.pdf',
					'2': 'https://meilai-test-3.oss-cn-hangzhou.aliyuncs.com/%E7%94%B5%E6%A2%AF%E6%A1%86%E6%9E%B6%E6%8B%8D%E7%85%A7%E6%A0%87%E5%87%86.pdf',
					// '3': '',
					'4': 'https://meilai-test-3.oss-cn-hangzhou.aliyuncs.com/%E5%8A%A0%E6%B2%B9%E7%AB%99%E6%8B%8D%E7%85%A7%E6%A8%A1%E6%9D%BF.pdf',
					'9': 'https://meilai-test-3.oss-cn-hangzhou.aliyuncs.com/%E7%BB%BC%E5%90%88%E5%B8%82%E5%9C%BA%E6%8B%8D%E7%85%A7%E6%A8%A1%E6%9D%BF.pdf',
					'11': 'https://meilai-test-3.oss-cn-hangzhou.aliyuncs.com/%E5%A4%A7%E5%B1%8F%E6%8B%8D%E7%85%A7%E6%A8%A1%E6%9D%BF.pdf',
				}
			}
		},
		watch: {},
		mounted() {
			this.getpdf()
		},
		methods: {
			getpdf() {
				this.pdfh5 = new Pdfh5("#pdf", {
					pdfurl: this.pdfUrl['' + this.$route.query.id]
				});
				//监听完成事件
				this.pdfh5.on("complete", function(status, msg, time) {
					console.log("状态：" + status + "，信息：" + msg + "，耗时：" + time + "毫秒，总页数：" + this.totalNum)
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	* {
		padding: 0;
		margin: 0;
	}
	html,
	body,
	#pdf-app {
		width: 100%;
		height: 100%;
	}
</style>
